blob: 2e4992970e84a1789cb97d35969976d12e5a30e1 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-pack-objects(1)
2===================
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-pack-objects - Create a packed archive of objects
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano7e9f6b72006-02-22 10:44:5511[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3812'git pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
Junio C Hamano125a17b2006-11-05 08:59:3513[--local] [--incremental] [--window=N] [--depth=N] [--all-progress]
Junio C Hamanod594fb62009-07-25 09:09:5414[--revs [--unpacked | --all]*] [--stdout | base-name]
15[--keep-true-parents] < object-list
Junio C Hamano1a4e8412005-12-27 08:17:2316
17
18DESCRIPTION
19-----------
20Reads list of objects from the standard input, and writes a packed
21archive with specified base-name, or to the standard output.
22
23A packed archive is an efficient way to transfer set of objects
24between two repositories, and also is an archival format which
25is efficient to access. The packed archive format (.pack) is
Junio C Hamanob553b792008-04-06 02:02:3726designed to be self contained so that it can be unpacked without
27any further information, but for fast, random access to the objects
28in the pack, a pack index file (.idx) will be generated.
Junio C Hamano1a4e8412005-12-27 08:17:2329
Junio C Hamano9810d632007-09-24 01:05:3430Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
31any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
32enables git to read from such an archive.
33
Junio C Hamanoba4b9282008-07-06 05:20:3134The 'git-unpack-objects' command can read the packed archive and
Junio C Hamano1a4e8412005-12-27 08:17:2335expand the objects contained in the pack into "one-file
36one-object" format; this is typically done by the smart-pull
37commands when a pack is created on-the-fly for efficient network
38transport by their peers.
39
Junio C Hamano7e9f6b72006-02-22 10:44:5540In a packed archive, an object is either stored as a compressed
41whole, or as a difference from some other object. The latter is
42often called a delta.
43
Junio C Hamano1a4e8412005-12-27 08:17:2344
45OPTIONS
46-------
47base-name::
48Write into a pair of files (.pack and .idx), using
49<base-name> to determine the name of the created file.
50When this option is used, the two files are written in
51<base-name>-<SHA1>.{pack,idx} files. <SHA1> is a hash
Junio C Hamanoa2ec14f2006-11-02 00:22:4852of the sorted object names to make the resulting filename
53based on the pack content, and written to the standard
Junio C Hamano1a4e8412005-12-27 08:17:2354output of the command.
55
56--stdout::
Junio C Hamano235a91e2006-01-07 01:13:5857Write the pack contents (what would have been written to
Junio C Hamano1a4e8412005-12-27 08:17:2358.pack file) out to the standard output.
59
Junio C Hamano3eb513f2006-09-18 02:47:1660--revs::
61Read the revision arguments from the standard input, instead of
62individual object names. The revision arguments are processed
Junio C Hamanoba4b9282008-07-06 05:20:3163the same way as 'git-rev-list' with the `--objects` flag
Junio C Hamano3eb513f2006-09-18 02:47:1664uses its `commit` arguments to build the list of objects it
65outputs. The objects on the resulting list are packed.
66
67--unpacked::
68This implies `--revs`. When processing the list of
69revision arguments read from the standard input, limit
70the objects packed to those that are not already packed.
71
72--all::
73This implies `--revs`. In addition to the list of
74revision arguments read from the standard input, pretend
Junio C Hamano93567a62006-10-08 08:47:5675as if all refs under `$GIT_DIR/refs` are specified to be
Junio C Hamano3eb513f2006-09-18 02:47:1676included.
77
Junio C Hamanobb343172008-03-09 10:39:0978--include-tag::
79Include unasked-for annotated tags if the object they
80reference was included in the resulting packfile. This
81can be useful to send new tags to native git clients.
82
Junio C Hamanoeb415992008-06-08 22:49:4783--window=[N]::
84--depth=[N]::
Junio C Hamano93567a62006-10-08 08:47:5685These two options affect how the objects contained in
Junio C Hamano1a4e8412005-12-27 08:17:2386the pack are stored using delta compression. The
87objects are first internally sorted by type, size and
88optionally names and compared against the other objects
89within --window to see if using delta compression saves
90space. --depth limits the maximum delta depth; making
91it too deep affects the performance on the unpacker
92side, because delta data needs to be applied that many
93times to get to the necessary object.
Junio C Hamano91d44c52007-05-09 07:16:0794The default value for --window is 10 and --depth is 50.
Junio C Hamano1a4e8412005-12-27 08:17:2395
Junio C Hamano235d53f2007-07-13 00:25:1596--window-memory=[N]::
97This option provides an additional limit on top of `--window`;
98the window size will dynamically scale down so as to not take
99up more than N bytes in memory. This is useful in
100repositories with a mix of large and small objects to not run
101out of memory with a large window, but still be able to take
102advantage of the large window for the smaller objects. The
103size can be suffixed with "k", "m", or "g".
104`--window-memory=0` makes memory usage unlimited, which is the
105default.
106
Junio C Hamano591dc6a2007-05-29 09:18:19107--max-pack-size=<n>::
108Maximum size of each output packfile, expressed in MiB.
109If specified, multiple packfiles may be created.
Junio C Hamano49dccaf2008-02-10 10:48:01110The default is unlimited, unless the config variable
111`pack.packSizeLimit` is set.
Junio C Hamano591dc6a2007-05-29 09:18:19112
Junio C Hamano28363492008-11-14 08:26:31113--honor-pack-keep::
114This flag causes an object already in a local pack that
115has a .keep file to be ignored, even if it appears in the
116standard input.
117
Junio C Hamano1a4e8412005-12-27 08:17:23118--incremental::
119This flag causes an object already in a pack ignored
120even if it appears in the standard input.
121
122--local::
123This flag is similar to `--incremental`; instead of
124ignoring all packed objects, it only ignores objects
Junio C Hamano28363492008-11-14 08:26:31125that are packed and/or not in the local object store
Junio C Hamano1a4e8412005-12-27 08:17:23126(i.e. borrowed from an alternate).
127
128--non-empty::
129 Only create a packed archive if it would contain at
130 least one object.
131
Junio C Hamano0d3c8152006-11-08 01:33:41132--progress::
133Progress status is reported on the standard error stream
134by default when it is attached to a terminal, unless -q
135is specified. This flag forces progress status even if
136the standard error stream is not directed to a terminal.
137
138--all-progress::
139When --stdout is specified then progress report is
140displayed during the object count and deltification phases
141but inhibited during the write-out phase. The reason is
142that in some cases the output stream is directly linked
143to another command which may wish to display progress
144status of its own as it processes incoming pack data.
145This flag is like --progress except that it forces progress
146report for the write-out phase as well even if --stdout is
147used.
148
Junio C Hamano7e9f6b72006-02-22 10:44:55149-q::
150This flag makes the command not to report its progress
151on the standard error stream.
152
153--no-reuse-delta::
154When creating a packed archive in a repository that
155has existing packs, the command reuses existing deltas.
156This sometimes results in a slightly suboptimal pack.
157This flag tells the command not to reuse existing deltas
158but compute them from scratch.
159
Junio C Hamanof2ce2972007-05-20 19:12:09160--no-reuse-object::
161This flag tells the command not to reuse existing object data at all,
162including non deltified object, forcing recompression of everything.
163This implies --no-reuse-delta. Useful only in the obscure case where
164wholesale enforcement of a different compression level on the
165packed data is desired.
166
167--compression=[N]::
168Specifies compression level for newly-compressed data in the
169generated pack. If not specified, pack compression level is
170determined first by pack.compression, then by core.compression,
171and defaults to -1, the zlib default, if neither is set.
Junio C Hamanofce7c7e2008-07-02 03:06:38172Add --no-reuse-object if you want to force a uniform compression
Junio C Hamanoef4c2d12007-09-10 08:11:27173level on all data no matter the source.
Junio C Hamanof2ce2972007-05-20 19:12:09174
Junio C Hamano77b7e902006-10-23 07:18:50175--delta-base-offset::
176A packed archive can express base object of a delta as
177either 20-byte object name or as an offset in the
178stream, but older version of git does not understand the
Junio C Hamanoba4b9282008-07-06 05:20:31179latter. By default, 'git-pack-objects' only uses the
Junio C Hamano77b7e902006-10-23 07:18:50180former format for better compatibility. This option
181allows the command to use the latter format for
182compactness. Depending on the average delta chain
183length, this option typically shrinks the resulting
184packfile by 3-5 per-cent.
185
Junio C Hamano58155b42007-09-15 07:46:14186--threads=<n>::
187Specifies the number of threads to spawn when searching for best
188delta matches. This requires that pack-objects be compiled with
189pthreads otherwise this option is ignored with a warning.
190This is meant to reduce packing time on multiprocessor machines.
191The required amount of memory for the delta search window is
192however multiplied by the number of threads.
Junio C Hamano24bc09a2008-02-28 00:27:44193Specifying 0 will cause git to auto-detect the number of CPU's
194and set the number of threads accordingly.
Junio C Hamano58155b42007-09-15 07:46:14195
Junio C Hamanoe90436a2007-04-22 07:22:13196--index-version=<version>[,<offset>]::
197This is intended to be used by the test suite only. It allows
198to force the version for the generated pack index, and to force
19964-bit index entries on objects located above the given offset.
200
Junio C Hamanod594fb62009-07-25 09:09:54201--keep-true-parents::
202With this option, parents that are hidden by grafts are packed
203nevertheless.
204
Junio C Hamano7e9f6b72006-02-22 10:44:55205
Junio C Hamano1a4e8412005-12-27 08:17:23206Author
207------
208Written by Linus Torvalds <torvalds@osdl.org>
209
210Documentation
211-------------
212Documentation by Junio C Hamano
213
Junio C Hamano9049d912008-05-29 02:09:50214SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23215--------
Junio C Hamano35738e82008-01-07 07:55:46216linkgit:git-rev-list[1]
217linkgit:git-repack[1]
218linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23219
220GIT
221---
Junio C Hamanof7c042d2008-06-06 22:50:53222Part of the linkgit:git[1] suite